<?php

use App\Http\Controllers\Sign;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use \App\Http\Controllers\Seckill;
use \App\Http\Controllers\Coupon;
use \App\Http\Controllers\RushBuy;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
*/

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});

//LLJ路由-------------------------------------------------------------------------------------------------------------
//图片上传
Route::post('imgUploade',[\App\Http\Controllers\feedController::class,'imgUploade']);
//反馈提交
Route::post('feedTarget',[\App\Http\Controllers\feedController::class,'feedTarget']);
//echars可视化
Route::get('echarts', [\App\Http\Controllers\LoginController::class, 'echarts']);
//授权登录
Route::post('auth_login', [\App\Http\Controllers\LoginController::class, 'authLogin']);
//验证码登录
Route::get('msg_login', [\App\Http\Controllers\LoginController::class, 'msgLogin']);
//发送短信
Route::get('send', [\App\Http\Controllers\LoginController::class, 'sendCaptcha']);
//获取用户足迹
Route::get('foot',[\App\Http\Controllers\LoginController::class,'foot']);

//------------------------------------------------------------------------------------------------------------------

Route::prefix('people')->group(function () {
    //微信授权登录
    Route::get('submit_login',[\App\Http\Controllers\BrankController::class,'submitLogin']);
    //绑定银行卡
    Route::post('bind_bank_car',[\App\Http\Controllers\BrankController::class,'bindBankCar']);
    // 判断支付密码是否正确
    Route::post('is_pay_password', [\App\Http\Controllers\BrankController::class, 'isPayPassword']);
   //获取个人信息
    Route::post('personal_information', [\App\Http\Controllers\BrankController::class, 'personalInformation']);
   //生成验证码
    Route::get('getCode', [\App\Http\Controllers\BrankController::class, 'getCode']);
    //判断验证码是否正确
    Route::post('isCode', [\App\Http\Controllers\BrankController::class, 'isCode']);
    //获取用户添加的银行卡
    Route::post('top_up',[\App\Http\Controllers\BrankController::class,'topUp']);
    //充值
    Route::post('skype',[\App\Http\Controllers\BrankController::class,'skype']);
});
/**
 * 商品订单支付
 */
Route::prefix('order')->group(function () {
    //查看所有商品
    Route::get('all_goods',[\App\Http\Controllers\OrderGoods::class,'allGoods']);
    //详情页面
    Route::get('detail',[\App\Http\Controllers\OrderGoods::class,'detail']);
    //立即购买
    Route::get('run_buy',[\App\Http\Controllers\OrderGoods::class,'runBuy']);
    //收货地址
    Route::get('address',[\App\Http\Controllers\OrderGoods::class,'address']);
    //打折
    Route::get('discount',[\App\Http\Controllers\OrderGoods::class,'discount']);
    //确认订单
    Route::post('affirmOrder',[\App\Http\Controllers\OrderGoods::class,'affirmOrder']);
    //判断是否支付成功
    Route::get('is_balance_pay',[\App\Http\Controllers\OrderGoods::class,'is_balance_pay']);
    //余额支付
    Route::post('balance_pay',[\App\Http\Controllers\OrderGoods::class,'balancePay']);
    //商品退款
    Route::post('refund',[\App\Http\Controllers\OrderGoods::class,'refund']);
    //策略
    Route::get('order',[\App\Http\Controllers\OrderGoods::class,'order']);
});
/**
 * 商品评论
 */
Route::prefix('comment')->group(function () {
    //获取商品评论
    Route::get('comment',[\App\Http\Controllers\CommentController::class,'get_goods_comment']);
});
/**
 * 消费记录
 */
Route::post('payRecode', [\App\Http\Controllers\BrankController::class, 'payRecode']);
/**
 * 支付明细
 */
Route::post('payDetail', [\App\Http\Controllers\BrankController::class, 'payDetail'])->middleware('Xss');


//---------------------------------------------------------------------------------------------------------------


//LSJ路由-------------------------------------------------------------------------------------------------------------

/**
 * 商品分类
 */
Route::get('goodsType', [\App\Admin\Controllers\GrTypeController::class, 'goodsType']);
/**
 * 订单分类
 */
Route::prefix('order')->group(function () {
    //所有订单
    Route::get('order_type', [\App\Http\Controllers\Order::class, 'orderType']);
    //待支付
    Route::get('order_no_pay', [\App\Http\Controllers\Order::class, 'orderNoPay']);
    //待发货
    Route::get('no_send_goods', [\App\Http\Controllers\Order::class, 'noSendGoods']);
    //待收货
    Route::get('no_receive_goods', [\App\Http\Controllers\Order::class, 'noReceiveGoods']);
    //待评价
    Route::get('no_appraise', [\App\Http\Controllers\Order::class, 'noAppraise']);
    //售后
    Route::get('after_sale', [\App\Http\Controllers\Order::class, 'afterSale']);
});

//用户签到
Route::get('user_sign',[Sign::class,'userSign']);
//用户补签
Route::get('supplement_sign',[Sign::class,'supplementSign']);
//用户签到信息展示
Route::get('user_sign_detail',[Sign::class,'userSignDetail']);


//用户秒杀
Route::post('user_seckill',[\App\Http\Controllers\Seckill::class,'userSeckill']);
//
Route::post('index',[\App\Http\Controllers\Seckill::class,'index']);

//Route::middleware(['loginAuth','throttle:20,1'])->group(function () {
    //用户签到
    Route::get('user_sign', [Sign::class, 'userSign']);
    //用户补签
    Route::get('supplement_sign', [Sign::class, 'supplementSign']);
    //用户签到信息展示
    Route::get('user_sign_detail', [Sign::class, 'userSignDetail']);
    //用户秒杀
    Route::post('user_seckill', [Seckill::class, 'userSeckill']);
    //可兑换优惠券列表
    Route::get('coupon_exchange_list', [Coupon::class, 'couponExchangeList']);
    //优惠券兑换
    Route::post('coupon_exchange', [Coupon::class, 'couponExchange']);
    //拼团商品预热
    Route::post('grouping_preheat', [Coupon::class, 'groupingPreheat']);
    //优惠券抢购
    Route::post('rushBuy_coupon', [RushBuy::class, 'rushBuyCoupon']);
//});




//ZYJ路由-------------------------------------------------------------------------------------------------------------


Route::get('groupList', [\App\Http\Controllers\GroupBooking::class, 'groupList']);

Route::get('show', [\App\Http\Controllers\GroupBooking::class, 'show']);

Route::get('goodsDetails', [\App\Http\Controllers\GroupBooking::class, 'goodsDetails']);

//Route::get('preheat', [\App\Http\Controllers\GroupBooking::class, 'preheat']);


Route::get('cartAddress', [\App\Http\Controllers\ShoppingCart::class, 'cartAddress']);
//获取地址
Route::get('getAddress', [\App\Http\Controllers\GroupBooking::class, 'getAddress']);

//获取城市
Route::get('getCity', [\App\Http\Controllers\GroupBooking::class, 'getCity']);
//添加地址
Route::post('addAddress', [\App\Http\Controllers\GroupBooking::class, 'addAddress']);
//设置地址默认
Route::post('addressDefault', [\App\Http\Controllers\GroupBooking::class, 'addressDefault']);
//删除地址
Route::get('delAddress', [\App\Http\Controllers\GroupBooking::class, 'delAddress']);


//Route::prefix('comment')->group(function () {
//
//    Route::get('comment',[\App\Admin\Controllers\GrUserCommentController::class,'getComment']);
//
//});

Route::get('groupGoods', [\App\Http\Controllers\GroupBooking::class, 'groupGoods']);
//
Route::post('beganGroup', [\App\Http\Controllers\GroupBooking::class, 'beganGroup']);
Route::post('groupAdd', [\App\Http\Controllers\GroupBooking::class, 'groupAdd']);


